<extend name="common"/>
<block name="title">卡密列表-{:C('web_name')}</block>
<block name="page">
<div class="row">
	<div class="col-xs-12">
		<ol class="breadcrumb">
			<li><a href="/"><span class="hidden-xs">{:C('web_name')}</span><span class="hidden-md hidden-lg">首页</span></a></li>
			<li><a href="{:U('index/user')}">用户中心</a></li>
			<li><a href="{:U('index')}">代理后台</a></li>
			<li class="active">卡密列表</li>
		</ol>
	</div>
</div>

<div class="row">
	<div class="col-xs-12">
		<ol class="breadcrumb">
		<li style="line-height: 45px;">共{$pages}页</li><li style="line-height: 45px;">{$count}条</li>
			<form class="navbar-form navbar-right" role="search" action="{:U('km','xz='.$xz.'&p='.$page)}" method="post"><input type="hidden" name="do" value="search">
				<div class="form-group ">
					<input type="text" style="width:60%;height: 33px;padding: 6px 12px;" name="key" placeholder="输入你要搜索的卡密"><button type="submit" class="btn btn-default">搜索</button>
				</div> 
			</form>
		</ol>
	</div>
	
	<div class="col-xs-12">
		<div class="list-group">
			<div class="list-group-item list-group-item-success">生成<if condition="$xz eq 'peie'">配额卡<elseif condition="$xz eq 'sy'"/>试用卡<else/>VIP卡</if>密密</div>
			<form action="{:U('km','xz='.$xz)}" role="form" class="form-horizontal" method="post"><input type="hidden" name="do" value="add">
			<div class="list-group-item">
				<div class="input-group col-xs-12">
					<div class="input-group-addon ">生成</div>
					<select name="num"class="form-control">
					<for start="1" end="11">
					<option value ="{$i}">{$i}</option>
					</for>
					</select>
					<div class="input-group-addon ">个</div>
					<select name="ms"class="form-control">
					<if condition="$xz eq 'peie'">
					<option value ="1">1个配额卡({:C('price_daili_1peie')}元)</option>
					<option value ="3">3个配额卡({:C('price_daili_3peie')}元)</option>
					<option value ="5">5个配额卡({:C('price_daili_5peie')}元)</option>
					<option value ="10">10个配额卡({:C('price_daili_10peie')}元)</option>
					<else/>
					<option value ="1">1月VIP卡({:C('price_daili_1vip')}元)</option>
					<option value ="3">3月VIP卡({:C('price_daili_3vip')}元)</option>
					<option value ="6">6月VIP卡({:C('price_daili_6vip')}元)</option>
					<option value ="12">12月VIP卡({:C('price_daili_12vip')}元)</option>
					<option value ="127">永久VIP卡({:C('price_daili_0vip')}元)</option>
					</if>
					</select>
				</div>
			</div>
			
			<div class="list-group-item">
				<input type="submit" name="submit" value="确认生成" class="btn btn-primary btn-block">
			</div>
			</form>
		</div>
	</div>
	<if condition="$msg"><div class="col-xs-12">{$msg}</div></if>
	<div class="col-xs-12">
		<div class="panel panel-primary">
			<div class="panel-heading">
				<h3 class="panel-title"><if condition="$xz eq 'peie'">配额卡<elseif condition="$xz eq 'sy'"/>试用卡<else/>VIP卡</if>密列表</h3>
			</div>
			<br>
			<div class="row" style="padding: 5px;">
				<volist name="list" id="km" key="k">
				<div class="col-xs-12 col-md-3">
					<div class="list-group">
						<h4 class="list-group-item list-group-item-info"><a href="{:U('qq','qid='.$qq['qid'])}">KID:{$km.kid}</a><a href="{:U('km','xz='.$xz.'&do=del&p='.$page.'&kid='.$km['kid'])}" onClick="if(!confirm('确认删除卡密:{$km.km}[KID:{$km.kid}]')){return false;}"><span class="glyphicon glyphicon-remove" aria-hidden="true" style="float:right;"></span></a></h4>
						<div class="list-group-item">
							<span class="glyphicon glyphicon-paperclip <if condition="$km['isuse']">red<else/>green</if>" aria-hidden="true">&nbsp;{$km.km}</span>
						</div>
						<div class="list-group-item">
							<span class="glyphicon glyphicon-user" aria-hidden="true">&nbsp;生成人:<if condition="$km['daili']">{$km.user}[UID:{$km.daili}]<else/><font color=green>管理员</font></if></span>
						</div>
						<div class="list-group-item">
							<span class="glyphicon glyphicon-random" aria-hidden="true">&nbsp;<if condition="$xz eq 'peie'">配额数：{$km.ms}个<elseif condition="$xz eq 'sy'"/>天数：{$km.ms}天<else/>月数：{$km.ms}月</if></span>
						</div>
						<div class="list-group-item">
							<span class="glyphicon glyphicon-time" aria-hidden="true">&nbsp;生成于:{$km.addtime}</span>
						</div>
						<div class="list-group-item <if condition="$km['isuse']">red list-group-item-warning<else/>green</if>">
							<span class="glyphicon glyphicon-th" aria-hidden="true">&nbsp;是否使用：<if condition="$km['isuse']">已使用<else/>未使用</if></span>
						</div>
						<if condition="$km['isuse']">
						<div class="list-group-item red list-group-item-warning">
							<span class="glyphicon glyphicon-user" aria-hidden="true">&nbsp;使用者UID:{$km.uid}</span>
						</div>
						<div class="list-group-item red list-group-item-warning">
							<span class="glyphicon glyphicon-time" aria-hidden="true">&nbsp;使用时间:{$km.usetime}</span>
						</div>
						</if>
					</div>
				</div>
				</volist>
			</div>
		</div>
	</div>
	<div class="col-xs-12">
		<div class="list-group-item list-group-item-info">
			<ul class="pagination">
			<if condition="$pages gt 1">
				<li><a href="{:U('km','xz='.$xz)}">首页</a></li>
				<for start="$start" end="$end+1">
				<li <if condition="$i eq $page">class="active"</if>><a href="{:U('km','xz='.$xz.'&p='.$i)}">{$i}</a></li>
				</for>
				<li><a href="{:U('km','xz='.$xz.'&p='.$pages)}">未页</a></li>
			</if>
			</ul>
		</div>
	</div>
</div>
</block>